<!--
 * @Author: xiawei 1243162387@qq.com
 * @Date: 2024-04-20 10:10:29
 * @LastEditors: xiawei 1243162387@qq.com
 * @LastEditTime: 2024-04-26 08:16:50
-->
<template>
    <VcTable ref="CustomTableRef" :columns="columns" :loading="loading" :data="tableData">
    </VcTable>
</template>
  
<script lang="ts" setup>
import { getTableList } from '@/api/index'
import useTable from '@/hooks/useTable'
const columns = [
    {
        'prop': 'key1',
        'label': '自定义formatter1',
        'formatter': (_row: any) => {
            return '我是格式化cell'
        },
    },
    {
        'prop': 'key2',
        'label': '自定义formatter2',
        'formatter': (_row: any) => {
            return '我是格式化cell2'
        },
    },
    {
        'prop': 'name',
        'label': '姓名',
    },
    {
        'label': '国家',
        'prop': 'city',
    },
    {
        'label': '城市',
        'prop': 'state',
    },
    {
        'label': '地址',
        'prop': 'address',
    },
    {
        'label': 'zip',
        'prop': 'zip',
    }
]
const {
    tableData,
    loading,
} = useTable({ tableApi: getTableList });
</script>